package easy;

public class Solution_1716 {
    public int totalMoney(int n) {
        int count = n / 7;
        int sum = 0;
        for (int i = 1; i <= count; i++) {
            sum += (i + i + 6) * 7 / 2;
        }
        int mod = n % 7;
        for (int i = 1; i <= mod; i++) {
            sum += (i + count);
        }
        return sum;
    }

    public static void main(String[] args) {
        Solution_1716 model = new Solution_1716();
        System.out.println(model.totalMoney(10));
    }
}
